Skip to content

Add GitHub Copilot CLI shell plugin#603

Open
eddumelendez wants to merge 2 commits into
1Password:mainfrom
eddumelendez:copilot-support
Open

Add GitHub Copilot CLI shell plugin#603
eddumelendez wants to merge 2 commits into
1Password:mainfrom
eddumelendez:copilot-support

Conversation

@eddumelendez

@eddumelendez eddumelendez commented May 29, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds a new GitHub Copilot shell plugin for the copilot CLI.

The plugin provisions an auth token through COPILOT_GITHUB_TOKEN, which is the environment variable supported by Copilot CLI. It also supports importing an existing token from COPILOT_GITHUB_TOKEN.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

N/A

How To Test

Run plugin validation:

make copilot/validate

Run the Copilot plugin tests:

go test ./plugins/copilot

Example authenticated command for functional testing:

copilot -p "explain this repo" -s

Changelog

Authenticate the GitHub Copilot CLI using Touch ID and other unlock options with 1Password Shell Plugins.

Copilot AI review requested due to automatic review settings May 29, 2026 04:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new shell-plugin for the GitHub Copilot CLI, enabling 1Password to manage the COPILOT_GITHUB_TOKEN credential used to authenticate the copilot CLI.

Changes:

  • Introduces the copilot plugin definition, platform info, and registration of the credential type + executable.
  • Defines the AuthToken credential (with env var mapping, provisioner, and importer) plus tests.
  • Defines the CopilotCLI executable with a NeedsAuth rule excluding help/version/login/logout/completion subcommands.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
plugins/copilot/plugin.go Registers the Copilot plugin with platform metadata, credentials, and executables.
plugins/copilot/copilot.go Defines the Copilot CLI executable and the conditions under which authentication is required.
plugins/copilot/auth_token.go Defines the AuthToken credential, env var mapping, provisioner, and importer.
plugins/copilot/auth_token_test.go Tests for the provisioner and importer behavior of the AuthToken credential.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/copilot/copilot.go Outdated
Comment thread plugins/copilot/copilot.go Outdated
Comment thread plugins/copilot/auth_token.go
Comment thread plugins/copilot/plugin.go
@eddumelendez eddumelendez changed the title Add GitHub Copilo CLI shell plugin Add GitHub Copilot CLI shell plugin May 29, 2026
Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>

@scottisloud scottisloud left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing a GitHub Copilot CLI plugin.
A few things before merge:

Auth gating (copilot.go)

Right now NeedsAuth is only NotForHelpOrVersion(). The CLI command reference documents several commands that should not require a 1Password item first:

  • copilot login — OAuth device flow (needsauth.NotForExactArgs("login"))
  • bare copilot — launches the interactive UI where users can /login (needsauth.NotWithoutArgs())
  • copilot completion SHELL — completion script output (needsauth.NotWhenContainsArgs("completion"))
  • copilot version — version subcommand (needsauth.NotForExactArgs("version"); NotForHelpOrVersion() covers -v/--version flags but not the subcommand)

Once you've had a chance to address those, I'll give it another look-over!

@eddumelendez eddumelendez requested a review from scottisloud June 19, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants